<template>
  <div>
    <p-table bordered :data-source="datalist" :columns="columns" :pagination='false'>
       <template slot="start">
          <p-switch checked-children="开" un-checked-children="关"/>
        </template>
    </p-table>
    
  </div>
</template>
<script>
export default {
  props:{
    datalist:{
      type:Array
    }
  },
  data() {
    return {
      count: 2,
      columns: [
        {
          title: '序号',
          dataIndex: 'idx',
          align: 'center',
          customRender:function (t,r,index) {
              return parseInt(index)+1;
            }
        },
        {
          title: '数据采集类型',
          dataIndex: 'itemText',
          align: 'center',
          scopedSlots:{customRender:'name'}
        },
        {
          title: '采集内容',
          dataIndex: 'itemValue',
          align: 'center'
        },
        {
          title: '是否启动',
          dataIndex: 'startUsing',
          scopedSlots: { customRender: 'start' },
          align: 'center'
        },
      ],
    };
  },
  methods: {
  },
};
</script>
<style>
.editable-cell {
  position: relative;
}

.editable-cell-input-wrapper,
.editable-cell-text-wrapper {
  padding-right: 24px;
}

.editable-cell-text-wrapper {
  padding: 5px 24px 5px 5px;
}

.editable-cell-icon,
.editable-cell-icon-check {
  position: absolute;
  right: 0;
  width: 20px;
  cursor: pointer;
}

.editable-cell-icon {
  line-height: 18px;
  display: none;
}

.editable-cell-icon-check {
  line-height: 28px;
}

.editable-cell:hover .editable-cell-icon {
  display: inline-block;
}

.editable-cell-icon:hover,
.editable-cell-icon-check:hover {
  color: #108ee9;
}

.editable-add-btn {
  margin-bottom: 8px;
}
</style>